package com.cnap.multiclouldmgmt.repository.master;

import com.cnap.multiclouldmgmt.model.AccountInfo;
import com.cnap.multiclouldmgmt.model.flavor.CloudFlavorInfo;
import com.cnap.multiclouldmgmt.model.flavor.CloudFlavorInfoV2;
import com.cnap.multiclouldmgmt.model.flavor.FlavorInfo;
import com.cnap.multiclouldmgmt.model.gpu.GpuFlavorInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.LinkedHashMap;
import java.util.List;

/**
 * @author dyq
 * 对接数据库操作语句
 */
@Mapper
public interface FlavorInfoMapper {

    /**
     * 获取
     * @param
     */
    List<CloudFlavorInfo> getAllCloudFlavorInfos();

    Double getPriceByFlavorId(@Param("flavorId") String flavorId);

    FlavorInfo getFlavfInfoByNameZone(@Param("regionId")String regionId,
                                      @Param("zoneId")String zoneId, @Param("flavorName")String flavorName);

    List<GpuFlavorInfo> getAllGpuCloudFlavorInfos();


    GpuFlavorInfo getGpuCloudFlavorInfo(@Param("accountName")String accountName,
                                        @Param("cloudType")String cloudType,
                                        @Param("regionId")String regionId,
                                        @Param("zoneId") String zoneId,
                                        @Param("flavorId") String flavorId);

    List<LinkedHashMap<String, String>> selectTest(@Param("gpu") String gpu, @Param("image") String image, @Param("cloudType") String cloudType);

    List<AccountInfo> getAllAccount();

    CloudFlavorInfoV2 getFlavorWithImageDisk(@Param("accountName")String accountName,
                                             @Param("cloudType")String cloudType,
                                             @Param("regionId")String regionId,
                                             @Param("zoneId") String zoneId,
                                             @Param("flavorId") String flavorId);

    CloudFlavorInfoV2 getPrivateFlavorWithImageDisk(@Param("accountName")String accountName,
                                                    @Param("cloudType")String cloudType,
                                                    @Param("regionId")String regionId,
                                                    @Param("zoneId") String zoneId,
                                                    @Param("flavorId") String flavorId);

    GpuFlavorInfo getPrivateGpuCloudFlavorInfo(@Param("accountName")String accountName,
                                               @Param("cloudType")String cloudType,
                                               @Param("regionId")String regionId,
                                               @Param("zoneId") String zoneId,
                                               @Param("flavorId") String flavorId);
}
